import request from '@/utils/request'

// 查询控制点类型列表
export function listLoopType(query) {
    return request({
        url: '/app-api/business/loopType/list',
        method: 'get',
        params: query
    })
}

/**
 * 查找一级目录
 */
export function listTypeLevel1() {
    return request({
        url: '/business/loopType/list/level1',
        method: 'get'
    })
}

/**
 * 通过一级找二级
 */
export function listTypeLevel2(loopTypeId) {
    return request({
        url: '/business/loopType/list/level2/' + loopTypeId,
        method: 'get'
    })
}

export function allLoopType() {
    return request({
        url: '/business/loopType/all',
        method: 'get'
    })
}

// 查询控制点类型详细
export function getLoopType(loopTypeId) {
    return request({
        url: '/business/loopType/' + loopTypeId,
        method: 'get'
    })
}

// 新增控制点类型
export function addLoopType(data) {
    return request({
        url: '/business/loopType',
        method: 'post',
        data: data
    })
}

// 修改控制点类型
export function updateLoopType(data) {
    return request({
        url: '/business/loopType',
        method: 'put',
        data: data
    })
}

// 删除控制点类型
export function delLoopType(loopTypeId) {
    return request({
        url: '/business/loopType/' + loopTypeId,
        method: 'delete'
    })
}
